/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * VMPanel.java
 *
 * Created on Aug 17, 2009, 9:27:51 AM
 */

package com.Cloudtap.UI;
import java.awt.*;
import javax.swing.*;
import java.util.*;
import com.Cloudtap.Backend.*;

/**
 *
 * @author Dharshan
 */
public class VMPanel extends javax.swing.JPanel {


    /** Creates new form VMPanel */
    public VMPanel(DataModel model) {
        initComponentsCustom(model);
    }


    
    private void initComponentsCustom(DataModel model)
    {
        //Create and initialize the UI constructs
        setName("BackgroundPane"); // NOI18N

        //Add the VM properties table
        jVMsTable = new JTable(new VMPanelTableModel(model));
        jVMsTable.setFillsViewportHeight(true);
        jVMsTable.setAutoCreateRowSorter(true);
        jVMsTable.setRowHeight(20);


        jBackgroundScrollPane = new JScrollPane(jVMsTable);
        jActionsPane = new ActionPanel();
        jBackgroundScrollPane.setName("VMPanelScrollPane"); // NOI18N
        jActionsPane.setName("VMActionsPane");


        //Set the layout
        this.setLayout(new GridBagLayout());
        GridBagConstraints c = new GridBagConstraints();
        c.fill = GridBagConstraints.BOTH;
        c.gridx = 0;
        c.gridy = 0;
        c.weightx = .9;
        c.weighty = 1;
        this.add(jBackgroundScrollPane,c);
        c.gridx = 1;
        c.gridy = 0;
        c.weightx = .1;
        this.add(jActionsPane,c);

        //Add the table columns

        //Add the labels
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setName("BackgroundPane"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 434, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 344, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

    JScrollPane jBackgroundScrollPane;
    JPanel jActionsPane;
    JTable jVMsTable;
}